package com.ruoyi.iot.listener;

import com.ruoyi.iot.service.MqttMessageSender;
import jakarta.annotation.Resource;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

import com.ruoyi.iotcommon.domain.CommandPostMessage;

/**
 * 监听iot-core服务下发的指令，转为设备指令
 */
@Service
@RocketMQMessageListener( topic = "iot-command-post-mqtt", consumerGroup = "iot-transform-mqtt")
public class CommandPostListener implements RocketMQListener<CommandPostMessage>{


    @Resource
    private MqttMessageSender mqttMessageSender;


    @Override
    public void onMessage(CommandPostMessage message) {
        // TODO 转为为设备指令，下发给设备
        //mqttMessageSender.send();
    }
    
}
